package com.pengtu.entity.report;


import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import org.apache.commons.lang.builder.ToStringBuilder;

import com.pengtu.entity.IdEntity;
import com.pengtu.utils.MathsUtils;

/**
 * Materialtest.
 */
@Entity
@Table(name="S_Q_REPORT_MATERIALTEST")
public class Materialtest  extends IdEntity {


     /**
	 * serialVersionUID:TODO
	 *
	 * @since 1.0.0
	 */
	
	 private static final long serialVersionUID = 1L;
     private String pid;
     private String sid;
     private String unit;
     private String category;
     private String arrivalMonth;
     private String arrivalTotal;
     private Double planMonth;
     private Double planTotal;
     private Double countMonth;
     private Double countTotal;
     private Double passMonth;
     private Double passTotal;
     private Double splanMonth;
     private Double splanTotal;
     private Double scountMonth;
     private Double scountTotal;
     private Double spassMonth;
     private Double spassTotal;
     private String batch;
     
     private String reporter;
     private String rechecker;
     
     private String attachment;
     private String remark;
     private Date checkdate;

    public Materialtest() {
    }

	
    
    @Column(name="PID", length=48)
    public String getPid() {
        return this.pid;
    }
    
    public void setPid(String pid) {
        this.pid = pid;
    }
    
    @Column(name="SID", nullable=false, length=48)
    public String getSid() {
        return this.sid;
    }
    
    public void setSid(String sid) {
        this.sid = sid;
    }
    
    @Column(name="UNIT", length=480)
    public String getUnit() {
        return this.unit;
    }
    
    public void setUnit(String unit) {
        this.unit = unit;
    }
    
    @Column(name="CATEGORY", length=180)
    public String getCategory() {
        return this.category;
    }
    
    public void setCategory(String category) {
        this.category = category;
    }
    
    @Column(name="ARRIVAL_MONTH", length=480)
    public String getArrivalMonth() {
        return this.arrivalMonth;
    }
    
    public void setArrivalMonth(String arrivalMonth) {
        this.arrivalMonth = arrivalMonth;
    }
    
    @Column(name="ARRIVAL_TOTAL", length=480)
    public String getArrivalTotal() {
        return this.arrivalTotal;
    }
    
    public void setArrivalTotal(String arrivalTotal) {
        this.arrivalTotal = arrivalTotal;
    }
    
    @Column(name="PLAN_MONTH", precision=18)
    public Double getPlanMonth() {
        return this.planMonth;
    }
    
    public void setPlanMonth(Double planMonth) {
        this.planMonth = planMonth;
    }
    
    @Column(name="PLAN_TOTAL", precision=18)
    public Double getPlanTotal() {
        return this.planTotal;
    }
    
    public void setPlanTotal(Double planTotal) {
        this.planTotal = planTotal;
    }
    
    @Column(name="COUNT_MONTH", precision=18)
    public Double getCountMonth() {
        return this.countMonth;
    }
    
    public void setCountMonth(Double countMonth) {
        this.countMonth = countMonth;
    }
    
    @Column(name="COUNT_TOTAL", precision=18)
    public Double getCountTotal() {
        return this.countTotal;
    }
    
    public void setCountTotal(Double countTotal) {
        this.countTotal = countTotal;
    }
    
    @Column(name="PASS_MONTH", precision=18)
    public Double getPassMonth() {
        return this.passMonth;
    }
    
    public void setPassMonth(Double passMonth) {
        this.passMonth = passMonth;
    }
    
    @Column(name="PASS_TOTAL", precision=18)
    public Double getPassTotal() {
        return this.passTotal;
    }
    
    public void setPassTotal(Double passTotal) {
        this.passTotal = passTotal;
    }
    
    @Column(name="SPLAN_MONTH", precision=18)
    public Double getSplanMonth() {
        return this.splanMonth;
    }
    
    public void setSplanMonth(Double splanMonth) {
        this.splanMonth = splanMonth;
    }
    
    @Column(name="SPLAN_TOTAL", precision=18)
    public Double getSplanTotal() {
        return this.splanTotal;
    }
    
    public void setSplanTotal(Double splanTotal) {
        this.splanTotal = splanTotal;
    }
    
    @Column(name="SCOUNT_MONTH", precision=18)
    public Double getScountMonth() {
        return this.scountMonth;
    }
    
    public void setScountMonth(Double scountMonth) {
        this.scountMonth = scountMonth;
    }
    
    @Column(name="SCOUNT_TOTAL", precision=18)
    public Double getScountTotal() {
        return this.scountTotal;
    }
    
    public void setScountTotal(Double scountTotal) {
        this.scountTotal = scountTotal;
    }
    
    @Column(name="SPASS_MONTH", precision=18)
    public Double getSpassMonth() {
        return this.spassMonth;
    }
    
    public void setSpassMonth(Double spassMonth) {
        this.spassMonth = spassMonth;
    }
    
    @Column(name="SPASS_TOTAL", precision=18)
    public Double getSpassTotal() {
        return this.spassTotal;
    }
    
    public void setSpassTotal(Double spassTotal) {
        this.spassTotal = spassTotal;
    }
    
    @Column(name="BATCH", length=200)
    public String getBatch() {
        return this.batch;
    }
    
    public void setBatch(String batch) {
        this.batch = batch;
    }
    
    @Column(name="REPORTER", length=480)
    public String getReporter() {
        return this.reporter;
    }
    
    public void setReporter(String reporter) {
        this.reporter = reporter;
    }
    
    @Column(name="RECHECKER", length=480)
    public String getRechecker() {
        return this.rechecker;
    }
    
    public void setRechecker(String rechecker) {
        this.rechecker = rechecker;
    }
    
    @Column(name="ATTACHMENT", length=480)
    public String getAttachment() {
        return this.attachment;
    }
    
    public void setAttachment(String attachment) {
        this.attachment = attachment;
    }
    
    @Column(name="REMARK", length=400)
    public String getRemark() {
        return this.remark;
    }
    
    public void setRemark(String remark) {
        this.remark = remark;
    }
    @Temporal(TemporalType.DATE)
    @Column(name="CHECKDATE", length=7)
    public Date getCheckdate() {
        return this.checkdate;
    }
    
    public void setCheckdate(Date checkdate) {
        this.checkdate = checkdate;
    }
    
    /**
     * 
     * getYield:
     * 适用:自检本月合格率,
     * @return 
     * @exception 
     * @since  1.0.0
     */
    @Transient
    public Double getSelfYieldM(){
    	return MathsUtils.div("3", this.getPassMonth(),this.getCountMonth());
    } 
    
    /**
     * 
     * getYield:
     * 适用:自检累计合格率,
     * @return 
     * @exception 
     * @since  1.0.0
     */
    @Transient
    public Double getSelfYieldT(){
    	return MathsUtils.div("3", this.getPassTotal(),this.getCountTotal());
    } 
    /**
     * 
     * getSelfRate:
     * 适用:本月自检频率
     * @return 
     * @exception 
     * @since  1.0.0
     */
    @Transient
    public Double getSelfRateM(){
    	return MathsUtils.div("3", this.getCountMonth(),this.getPlanMonth());
    }
    
    /**
     * 
     * getSelfRate:
     * 适用:累计自检频率
     * @return 
     * @exception 
     * @since  1.0.0
     */
    @Transient
    public Double getSelfRateT(){
    	return MathsUtils.div("3", this.getCountTotal(),this.getPlanTotal());
    }
    
    /**
     * 
     * getYield:
     * 适用:本月抽检合格率,
     * @return 
     * @exception 
     * @since  1.0.0
     */
    @Transient
    public Double getRandomYieldM(){
    	return MathsUtils.div("3",this.getSpassMonth(),this.getScountMonth());
    } 
    
    /**
     * 
     * getYield:
     * 适用:累计抽检合格率,
     * @return 
     * @exception 
     * @since  1.0.0
     */
    @Transient
    public Double getRandomYieldT(){
    	return MathsUtils.div("3",this.getSpassTotal(),this.getScountTotal());
    } 
    
    /**
     * 
     * getSelfRate:
     * 适用:本月抽检频率
     * @return 
     * @exception 
     * @since  1.0.0
     */
    @Transient
    public Double getRandomRateM(){
    	return MathsUtils.div("3",this.getScountMonth(),this.getSplanMonth()); 
    }
    
    /**
     * 
     * getSelfRate:
     * 适用:累计抽检频率
     * @return 
     * @exception 
     * @since  1.0.0
     */
    @Transient
    public Double getRandomRateT(){
    	return MathsUtils.div("3",this.getScountTotal(),this.getSplanTotal()); 
    }
    
	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this);
	}
}


